//
//  ShopMainClassifyCell.m
//  BaseFrame
//
//  Created by wingfac on 2017/8/9.
//  Copyright © 2017年 com.mxh. All rights reserved.
//

#import "ShopMainClassifyCell.h"
@interface ShopMainClassifyCell()<UITextFieldDelegate>
@property (nonatomic,strong)UIButton *shopImgBUtton;
@property (nonatomic,copy) UITextField *textField;
@end
@implementation ShopMainClassifyCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        _shopImgBUtton = [[UIButton alloc] initWithFrame:CGRectMake(30/WIDTH_5S_SCALE, (kShopMainClassifyCellHeight - 75/WIDTH_5S_SCALE)/2, 100/WIDTH_5S_SCALE, 75/WIDTH_5S_SCALE)];
        _shopImgBUtton.titleLabel.font = DEF_FontSize_13;
        [_shopImgBUtton setBackgroundColor:getColor(@"f1f2f6")];
        [_shopImgBUtton addTarget:self action:@selector(setShopImage:) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:self.shopImgBUtton];
        
        _textField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.shopImgBUtton.frame)+5, (kShopMainClassifyCellHeight - 20/WIDTH_5S_SCALE)/2, SCREEN_WIDTH - 150/WIDTH_5S_SCALE, 20/WIDTH_5S_SCALE)];
        _textField.delegate = self;
        _textField.font = DEF_FontSize_14;
        _textField.placeholder = @"分类名称";
        _textField.textColor = getColor(textColor);
        [self.contentView addSubview:self.textField];

        UIView *line1 = [[UIView alloc] initWithFrame:CGRectMake(0, kShopMainClassifyCellHeight-0.5/WIDTH_5S_SCALE, SCREEN_WIDTH, 0.5/WIDTH_5S_SCALE)];
        line1.backgroundColor = getColor(dividerColor);
        [self.contentView addSubview:line1];
        
    }
    return self;
}
- (void)setShopImage:(UIButton *) button{
    if(self.setShopImageBlock){
        self.setShopImageBlock(button);
    }
}
@end
